package com.chaoyi.service.Impl;

import com.chaoyi.dao.mysql.VideoCollectionMapper;
import com.chaoyi.doman.koreanvideo.VideoCollectionOutput;
import com.chaoyi.model.VideoCollection;
import com.chaoyi.service.VideoCollectionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: 卜加超
 * @Date: 2018/12/26 11:23
 * @Description:
 */
@Service
public class VideoCollectionServiceImpl implements VideoCollectionService {
    private Logger logger = LoggerFactory.getLogger(VideoCollectionServiceImpl.class);
    @Resource
    private VideoCollectionMapper videoConllectionMapper;
    @Override
    public int findCount(VideoCollectionOutput videoCollectionOutput) {
        return videoConllectionMapper.findCount(videoCollectionOutput);
    }

    @Override
    public List<VideoCollectionOutput> findList(int offset, int limit,VideoCollectionOutput videoCollectionOutput) {
        return videoConllectionMapper.findList(offset,limit, videoCollectionOutput);
    }

    @Override
    public int addVideoCollectionSave(VideoCollection entity) {
        return videoConllectionMapper.addVideoCollectionSave(entity);
    }

    @Override
    public VideoCollectionOutput selectVideoOne(int id) {
        return videoConllectionMapper.selectVideoOne(id);
    }

    @Override
    public int edit(VideoCollectionOutput entity) {
        return videoConllectionMapper.updateVideoCollection(entity);
    }

    @Override
    public int deleteVideoCollection(int id) {
        return videoConllectionMapper.deleteVideoCollection(id);
    }

    @Override
    public List<VideoCollection> getVideoCollectionList(int videoType, int page, int pageSize) {
       List<VideoCollection> videoCollectionList = videoConllectionMapper.getVideoCollectionList(videoType, page, pageSize);
        logger.info("视频列表："+videoCollectionList.toString());
       return videoCollectionList;
    }


}
